// 动态调整元素大小
const changeVideoSize = function changeVideoSize() {
  let width = window.innerWidth;
  let height = window.innerHeight;

  // 默认为 24 px
  let fontSize = 24;

  const video = document.getElementById("video");
  const html = document.getElementsByTagName("html")[0];

  if (width > (height * 16) / 9) {
    width = (height * 16) / 9;
  } else {
    height = (width * 9) / 16;
  }

  fontSize = (fontSize * width) / 1280;
  video.style.height = height + "px";
  video.style.width = width + "px";
  html.style.fontSize = fontSize + "px";
};

window.onresize = changeVideoSize;
changeVideoSize();
